function(find_kysdk_package prj_name kysdk_package_name)
    pkg_check_modules(${kysdk_package_name}_PKG ${kysdk_package_name})
    target_include_directories(${prj_name} PRIVATE ${${kysdk_package_name}_PKG_INCLUDE_DIRS})
    target_link_directories(${prj_name} PRIVATE ${${kysdk_package_name}_PKG_LIBRARY_DIRS})
    target_link_libraries(${prj_name} ${${kysdk_package_name}_PKG_LIBRARIES})
endfunction()


function(target_link_kysdk_libraries prj_name)
    find_package(PkgConfig REQUIRED)

    find_kysdk_package(${prj_name} kysdk-qtwidgets)
    find_kysdk_package(${prj_name} kysdk-diagnostics)
    find_kysdk_package(${prj_name} kysdk-log)
    find_kysdk_package(${prj_name} kysdk-utils)
    find_kysdk_package(${prj_name} kysdk-config)
    find_kysdk_package(${prj_name} kysdk-waylandhelper)
    find_kysdk_package(${prj_name} kysdk-alm)
    find_kysdk_package(${prj_name} kysdk-sysinfo)
endfunction()

function(target_link_glib_libraries prj_name)
    find_package(PkgConfig REQUIRED)
    pkg_search_module(GLIB REQUIRED glib-2.0)
    include_directories(${GLIB_INCLUDE_DIRS})
    target_link_libraries(${prj_name} "-lglib-2.0")
endfunction()

function(target_link_qgsettings_libraries prj_name)
    find_package(PkgConfig REQUIRED)
    pkg_check_modules(QGSETTINGS REQUIRED IMPORTED_TARGET gsettings-qt)
    target_link_libraries(${prj_name} PkgConfig::QGSETTINGS)
endfunction()

function(target_link_X11_libraries prj_name)
    target_link_libraries(${prj_name} -lX11)
endfunction()

function(target_link_KWindowSystem_libraries prj_name)
    find_package(KF5WindowSystem REQUIRED)
    target_link_libraries(${prj_name} KF5::WindowSystem)
endfunction()